package com.finance_provider.controller;

import com.entity.SaleAdvance;
import com.finance_provider.service.SaleAdvanceService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: RinPromise
 * @Date: 2021/9/22 14:58
 */
@RestController
public class SaleAdvanceController {

    @Resource
    private SaleAdvanceService saleAdvanceService;


    @RequestMapping("/addSaleAdvance")
    public Boolean addSaleAdvance(SaleAdvance saleAdvance){
        return saleAdvanceService.addSaleAdvance(saleAdvance);
    }

    @RequestMapping("/updateSaleAdvance")
    public Boolean updateSaleAdvance(SaleAdvance saleAdvance){
        return saleAdvanceService.updateSaleAdvance(saleAdvance);
    }

    @RequestMapping("/querySaleAdvance")
    public List<SaleAdvance> querySaleAdvance(SaleAdvance saleAdvance){
        return saleAdvanceService.querySaleAdvance(saleAdvance);
    }

    @RequestMapping("/querySaleAdvanceId/{id}")
    SaleAdvance querySaleAdvanceId(@PathVariable("id") Long id){
        return saleAdvanceService.querySaleAdvanceId(id);
    }

    @RequestMapping("/deleteSaleAdvance/{id}")
    public Boolean deleteSaleAdvance(@PathVariable("id") Long id) {
        return saleAdvanceService.deleteSaleAdvance(id);
    }

}
